<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Article</title>
	<link rel="stylesheet" href="/ecofitness/css/stylebase.css">
	<link rel="stylesheet" href="/ecofitness/css/default.css">
	<link rel="stylesheet" href="/ecofitness/css/fonts.css">
</head>
<body>
	<form action="/ecofitness/sign.view"  method=post>
			<input type="submit" name="submit" value="Deconnexion">
	</form>
	<form action="/ecofitness/profile.view"  method=get>
			<input type="submit" name="submit" value="Profile">
	</form>

	<c:choose>
	      <c:when test="${empty cookie.login.value}">
      			<jsp:forward page="home.jsp" />
		 	</c:when>
		 	<c:otherwise>
		 		<fieldset>
			    	<legend>Article ${article.id}:</legend>
			 		<div id="error">${error}</div>  
					<form action="/ecofitness/article/update.view"  method=post enctype="multipart/form-data">
						<input type="hidden" id="idArticle" name="idArticle" value="${article.id}"/>
						<label for="label">Label: </label>
						<input type="text" value="${article.label}" name="label" id="label" /><br/>
						<label for="photo">Photo <img src="${article.photo}" alt="${article.photo}" width="100" height="100"/>: </label>
						<input type="file" name="photo" size="50" value="${article.photo}"/><br/>
						<label for="description">Description: </label>
						<textarea rows="4" cols="50" id="description" name="description">
							${article.description}
						</textarea>
						<br/>
						<label for="point">Point: </label>
						<input type="text" value="${article.point}" id="point" name="point"/>
						<br/>
						
						<input type="submit" name="submit" value="Update">
				 	</form>
			 	</fieldset>
		 	</c:otherwise>
 	</c:choose>
	
</body>
</html>